﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Portal/Master/Portal.Master" AutoEventWireup="true" CodeBehind="DealerRegisterList.aspx.cs" Inherits="Besture.UI.Portal.DealerRegister.DealerRegisterList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="stylesheet" href="/Resource/css/normalize.css" />
    <link rel="stylesheet" href="/Resource/css/common.css" />
    <link rel="stylesheet" href="/Resource/css/base.css" />
    <link href="/Resource/css/index.css" rel="stylesheet" />
    <link href="/Resource/source/DatePicker/date.css" rel="stylesheet" />
    <script type="text/javascript" src="/Resource/js/modernizr-2.6.2.min.js"></script>
    <link href="/Resource/css/qa.css" rel="stylesheet" />
    <link href="/Resource/source/FancyBox/jquery.fancybox.css" rel="stylesheet" />
    <script type="text/javascript" src="/Resource/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="/Resource/js/common.js"></script>
    <script type="text/javascript" src="/Resource/source/FancyBox/jquery.fancybox.js"></script>
    <script type="text/javascript" src="/Resource/js/jquery.validate.js"></script>
    <style>
        .main .login_body .login_body_content .register_body .phone_number1 > a {display: block;line-height: 40px;border-radius: 4px;border: none;float: left;font-family: "Microsoft YaHei";font-size: 14px;color: #0281ae;border: 1px solid #88cfeb;background-color: #d4f2fd;cursor: pointer;text-align: center;}
    </style>
    <script type="text/javascript">
        $(function () {
            $("form").validate({
                rules: {
                    ctl00$Content$newpwd: {
                        required: true,
                        minlength: 6,
                        maxlength: 16
                    },
                    rpwd: {
                        required: true,
                        equalTo: "#ctl00_Content_newpwd"
                    }
                },
                messages: {
                    ctl00$Content$newpwd: {
                        required: "请填写密码",
                        minlength: "密码至少6位",
                        maxlength: "密码不能超过16位"
                    },
                    rpwd: {
                        required: "请再次输入密码",
                        equalTo: "两次密码输入不一致"
                    }
                },
                errorPlacement: function (error, element) {
                    error.css({ "margin-top": "10px", "margin-left": "2px" });
                    element.after(error);
                },
                highlight: function (element, errorClass, validClass) {

                },
                unhighlight: function (element, errorClass) {
                }
            });
        })
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="server">
    <div class="main">
        <div class="reg_main dealer-main">
            <div class="reg_body dealer">
                <div class="title1">经销商注册</div>
                <div class="getlogin1">已有账号,<a href="/Portal/UserCenter/Login.aspx">立即登录</a></div>
                <br class="clear" />
                <div class="reg_body_txt">
                    <div class="txt">
                        <img src="/Resource/images/xin.png" alt="" />用户名：
                    </div>
                    <div class="ip">
                        <asp:TextBox ID="txtLoginName" class="required" runat="server"></asp:TextBox>
                    </div>
                </div>
                <div class="reg_body_txt">
                    <div class="txt">
                        <img src="/Resource/images/xin.png" alt="" />密码：
                    </div>
                    <div class="ip">
                        <input type="password" runat="server" name="newpwd" id="newpwd" />
                    </div>
                </div>

                <div class="reg_body_txt">
                    <div class="txt">
                        <img src="/Resource/images/xin.png" alt="" />确认密码：
                    </div>
                    <div class="ip">
                        <input type="password" name="rpwd" />
                    </div>
                </div>

                <div class="reg_body_txt">
                    <div class="txt">
                        <img src="/Resource/images/xin.png" alt="" />企业名称：
                    </div>
                    <div class="ip">
                        <asp:TextBox ID="txtCompanyName" class="required" runat="server"></asp:TextBox>
                    </div>
                </div>
                <div class="reg_body_txt">
                    <div class="txt">
                        <img src="/Resource/images/xin.png" alt="" />指定联系人：
                    </div>
                    <div class="ip">
                        <asp:TextBox ID="txtRepresentative" class="required" runat="server"></asp:TextBox>
                    </div>
                </div>
                
                <div class="reg_body_txt">
                    <div class="txt">
                        <img src="/Resource/images/xin.png" alt="" />邮箱地址：
                    </div>
                    <div class="ip">
                        <asp:TextBox ID="txtEmail" class="required email" runat="server"></asp:TextBox>
                    </div>
                </div>

                <div class="reg_body_txt">
                    <div class="txt">
                        <img src="/Resource/images/xin.png" alt="" />手机号码：
                    </div>
                    <div class="ip">
                        <asp:TextBox ID="txtPhone" class="required mobile" runat="server"></asp:TextBox>
                    </div>
                </div>

                <div class="reg_body_txt code">
                    <div class="txt">
                        <img src="/Resource/images/xin.png" alt="" />验证码：
                    </div>
                    <div class="ipt">
                        <input name="phone" />
                    </div>
                    <div class="register_body">
                        <div class="phone_num"></div>
                        <div class="phone_number"><a href="JavaScript:void(0)" class="getphonecode">免费获取验证码</a></div>
                    </div>
                </div>

                <div class="reg_body_txt sell">
                    <div class="txt">公司座机：</div>
                    <div class="ipt">
                        <asp:TextBox ID="txtAreaCode" class="sel" runat="server"></asp:TextBox>-
                                <asp:TextBox ID="txtTel" class="sell" runat="server"></asp:TextBox>-
                                <asp:TextBox ID="txtTelExt" class="sel" runat="server"></asp:TextBox>
                        <br class="clear" />
                    </div>

                </div>


                <div class="reg_body_txt">
                    <div class="txt">详细地址：</div>
                    <div class="ip">
                        <asp:TextBox ID="txtAddress" class="addr required" runat="server"></asp:TextBox>
                    </div>
                </div>

                <div class="stipulate">
                    <label>
                        <input type="checkbox" id="cbClause" runat="server" class="checbax" />
                        我已经阅读并同意
                    </label>
                    <a href="javascript:void(0)" class="clause">《翔盛服务条款》</a>
                </div>
                <asp:Button ID="btnSave" runat="server" class="subimt" Text="注    册" OnClick="BtnSaveClick" />
            </div>
        </div>
        <!--弹窗-->
        <div class="affirm_main dealer-con" style="display: none; position: absolute; left: 28%; margin-right: 320px; top: 23%; z-index: 10; height: 270px;">
            <div class="terms">
                <p class="terms-title">&lt;&lt;翔盛国旅服务条款&gt;&gt;</p>
                <dl>
                    <dt>1．翔盛国旅服务条款的确认</dt>
                    <dd>翔盛国旅的所有权与运作权归翔盛国旅有限公司所有。本服务条款具有法律约束力。一旦您点选 "注册
                            "并通过注册程序，即表示您自愿接受本协议之所有条款，并已成为翔盛国旅的注册会员。
                            用户在享用翔盛国旅会员服务的同时，同意接受翔盛国旅会员服务提供的各类信息服务。
                    </dd>
                    <dt>2．服务内容</dt>
                    <dd>
                        <p>2.1 翔盛国旅服务的具体内容由同程根据实际情况提供</p>
                        <p>
                            2.2 翔盛国旅向其会员提供相关网络服务，与相关网络服务有关的设备（如个人电脑、手机、及其他与
                                接入互联网或移动网有关的装置）及所需的费用（如为接入互联网而支付的电话费及上网费、为使.....
                        </p>
                    </dd>
                </dl>
            </div>
            <p class="close"><a href="#" class="sub">关&nbsp;闭</a></p>
        </div>
        <!--遮罩-->
        <img src="/Resource/images/mask-bg.png" style="display: none" />
        <div class="mask" style="position: absolute; left: 0; top: 0; width: 100%; background: url(/Resource/images/mask-bg.png) repeat left top; display: none;"></div>
    </div>
    <script type="text/javascript">
         
        $(function () { 
            //弹窗
            $(".clause").fancybox();

            $(".clause").live("click", function (e) {
                $(".mask").height($(document).height());
                $(".mask").fadeIn(function () {
                    $(".affirm_main").fadeIn();
                });
                e.stopPropagation();
            });

            $(".close .sub").click(function () {
                $(this).parent().parent().fadeOut();
                $(".mask").fadeOut();
                $("input:checkbox").attr("checked", true);
            });

            //发送手机验证码
            var isSendingPhoneCode = false;
            var isPhoneCodeSended = false;
            $(".getphonecode").click(function () {
                if (isSendingPhoneCode) return false;
                isSendingPhoneCode = true;
                var _this = $(this);
                var time = 60;
                var text = $(this).text();
                var t = setInterval(function () {
                    time--;
                    if (time == 0) {
                        clearInterval(t);
                        isSendingPhoneCode = false;
                        _this.text(text);
                    } else {
                        _this.text(time + "秒后重新发送");
                        //发送手机验证码--操作
                        $.post("/Portal/UserCenter/AjaxUserInfo.aspx", { "Phone": $("#<%=txtPhone.ClientID%>").val(), "requestMethod": "PhoneSendSmsSend" }, function (data) {
                            //手机验证码已经发送
                            isPhoneCodeSended = true;
                            BlurPhone();
                        });
                    }
                }, 1000);
                return false;
            });

            //异步判断手机号是否唯一
            $("#<%=txtPhone.ClientID %>").blur(function () {
                $.post("/Portal/UserCenter/AjaxUserInfo.aspx", { "Phone": $("#<%=txtPhone.ClientID%>").val(), "UserType" : "2",  "requestMethod": "ajax_phone" }, function (data) {
                    if (data > 0) {
                        alert("该手机号已被注册");
                        return false;
                    }
                    return true;
                });
            });

            //异步判断邮箱是否唯一
            $("#<%=txtEmail.ClientID %>").blur(function () {
                $.post("/Portal/UserCenter/AjaxUserInfo.aspx", { "requestMethod": "ajax_email", "UserType" : "2",  "Email": $("#<%=txtEmail.ClientID %>").val() }, function (data) {
                    if (data > 0) {
                        alert("该邮箱已被注册");
                        return false;
                    }
                    return true;
                });
            }); 

            
            $(".subimt").click(function () { 
                
                if ($("#<%=txtPhone.ClientID%>").val().length > 0) {
                    //服务条款
                    if ($("input[type='checkbox']").attr("checked") !== "checked") {
                        alert("请选择服务条款");
                        return false;
                    }
                    //校验短信验证码 是否正确 
                    var v = <%=(string) Session["registerPhoneCode"] !=""?Session["registerPhoneCode"]:"0" %>;
                    if (parseInt($("input[name='phone']").val()) !== v) {
                        alert("请输入正确验证码");
                        return false;
                    }
                }
            });

        });
    </script>
</asp:Content>
